<?php	
	$path_one = 'admin/admin_project';
	$path_two = 'admin/car_set';
	$filename = 'admin/car_set';
	require_once("header.php");
	require_once("admin_comm.php");
	require_once $_site->get_handlepath('project');
		
	$rtn_type=array(1=>'挖机编号',2=>'线路设置',10=>'运距分类',5=>'司机设置',3=>'机手设置',4=>'地块设置',6=>'油罐',7=>'用油设备',8=>'油料管理员',9=>'施工员');
	$type=request('type',false,true,false,1);
	
	$admin_obj = new admin();
	$user_info = $admin_obj->out_cookie();
	if($user_info['id']==1){		
		$result=$admin_obj->search_customer("id,account,name");
		$pid=request('pid',false,true,false,0);
	}else{
		$pid=$user_info['id'];
	}	    
    
    if($pid){
    	$device_obj=new device();
    	$_ary=$device_obj->setinfo_search($pid,$type);    	    	
    }
?>
<script type="text/javascript" charset="utf-8">
	loader.file({
		plugin:['validform/main','dialog/main'],
		skincss:['list']
	})	
	
    //修改记录
	function editinfo(id){
		var title='<?php echo $rtn_type[$type];?>';
		dialog.iframe({
			title:title,
			is_resize:false,
			top:{
				is_show:true,
				btn_max:false,
				btn_min:false,
				btn_close:true,
				height:33,
				is_move:true
			},
			is_scroll:false,
			min_width:550,
			min_height:400,
			is_center:true,
			is_lock_back:true,
			content:'/admin/car_edit?id='+id+'&type=<?php echo $type;?>&pid=<?php echo $pid;?>',
			name:'choise_project'
		});
	}	



    //导入记录
	function importinfo(){
		var title='<?php echo $rtn_type[$type];?>';
		dialog.iframe({
			title:title,
			is_resize:false,
			top:{
				is_show:true,
				btn_max:false,
				btn_min:false,
				btn_close:true,
				height:33,
				is_move:true
			},
			is_scroll:false,
			min_width:550,
			min_height:400,
			is_center:true,
			is_lock_back:true,
			content:'/admin/car_edit_import?type=<?php echo $type;?>&pid=<?php echo $pid;?>',
			name:'choise_project'
		});
	}	
	
	

	function del(id){
        if(!confirm('该操作不可撤销，是否删除？'))return false;
        $.getJSON("/handle.php?h=device/cardel&id="+id,function(res){
            if(res.state){
            	location.reload(true);
            	return;
            }
            alert(res.msg);
        })
    }

	
	function change(){
       location.reload(true);
	}
</script>
<style>
.dishes_top{width:100%}
.dishes_top a{text-decoration:none}
.dishes_top ul{float:left;width:100%;margin-top:10px}
.dishes_top ul li{display:inline-block;padding:0 1px}
.dishes_top ul li a{display:block;font-size:14px;height:35px;line-height:35px;width:90px;background-color:#eeeeee;color:#454545;font-size:14px;text-align:center}
.dishes_top ul li a:hover{background-color:#79473a;color:#ffffff}
.dishes_top ul li a.hover{background-color:#79473a;color:#ffffff}
.oper .btn{padding: 5px;background: red;color: white;border-radius: 2px;padding: 5px 15px;display: inline-block;cursor: pointer;}
.oper a:hover{background-color:#790d0d;text-decoration:none !important;color:white !important}
</style>
</head>
<body>
	<div class="position_nav">你所在的当前位置：<?php echo $path_str;?></div>
		<div class="main">

		<?php 
		 if($user_info['id']==1){
		?>
			<div class="sos_box">
				<form action="/admin/car_set" id="search" method='get'>
					<span>项目经理：</span>
				    <select name='pid'>
					   <option value="">请选择</option>
					      <?php 
					      if($result){
					      foreach($result as $key=>$val){
                          ?>
                             <option value="<?php echo $val['id']?>" <?php if($val['id']==$pid){echo "selected";} ?>><?php echo $val['name']?></option>
                          <?php 
                             }
                          }
					      ?>					 
					</select>						
					<input class="button1" type="submit" value="搜索">
				</form>
			</div>
			<?php 
			}
			?>


			<div class="dishes_top">
			   <ul>			  
			     <?php foreach($rtn_type as $key=>$vo){  ?>  				     		
				 <li><a<?php echo $type==$key?' class="hover"':'';?> href="?type=<?php echo $key;?>&pid=<?php echo $pid;?>"><?php echo $vo ?></a></li>				 				     		
				 <?php } ?>
			  </ul>	
			  
			</div>				
			
			<table cellpadding="0" cellspacing="1" border="0" class="table">
			    <?php 
			     if(empty($pid)){
			    ?>
				<tr>
					<td colspan="8">
						<div class="list_more">
							<font color="red">请选择相应项目项目经理！</font>
						</div>
					</td>
				</tr>
				<?php 
				 }
				?>						
			</table>
			
					    		    
		    <?php 
		       if($pid){
		    
			      //挖机设置
			      if(1==$type){            	
				     require_once("car_set_wj.php");		
				  }elseif(2==$type){
				  	 require_once("car_set_line.php");
				  }elseif(3==$type){
				  	 require_once("car_set_js.php");
				  }elseif(4==$type){
				  	 require_once("car_set_dk.php");
				  }elseif(5==$type){
				  	 require_once("car_set_sj.php");
				  }elseif(6==$type){
				  	 require_once("car_set_yg.php");
				  }elseif(7==$type){
				  	 require_once("car_set_jyc.php");
				  }elseif(8==$type){
				  	 require_once("car_set_ylgly.php");
				  }elseif(9==$type){
				  	 require_once("car_set_sgy.php");
				  }elseif(10==$type){
                     require_once("car_set_yunj.php");
                  }
				  
			  }
			?>	

			
		</div>
	</div>
</body>
</html>


